package com.smart.seckilldemo.rocketmq.consumer;

import com.smart.seckilldemo.commons.dto.GenerateSeckillOrder;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 延迟消息队列接收 检查订单是否完成生成 或者支付
 *
 * 第二
 */

@Component
@Slf4j
@RocketMQMessageListener(topic = "tp_topic_2",consumerGroup = "consumer_grp_02")
public class DelayListener implements RocketMQListener<GenerateSeckillOrder> {

    @Override
    public void onMessage(GenerateSeckillOrder msg) {
            log.info("延迟检查队列接收到"+msg);
            log.info("订单生成成功 购买成功通知用户");
            log.info("订单号:"+msg.getOrderId());
    }
}
